#include <jni.h>
#include <string>

extern "C" JNIEXPORT jstring JNICALL
Java_com_vlcdemo_cppdemo_MainActivity_stringFromJNI(
        JNIEnv* env,
        jobject /* this */) {
    std::string hello = "Hello from C++";
    return env->NewStringUTF(hello.c_str());
}

#include <sys/eventfd.h>
#include <sys/epoll.h>

extern "C" JNIEXPORT jstring JNICALL
Java_com_vlcdemo_cppdemo_MainActivity_stringFrom(
        JNIEnv* env,
        jobject /* this */) {

    fd_set fdSet;

    FD_ZERO(&fdSet);
    int  inotifyFd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);

    FD_SET(inotifyFd, &fdSet);

    struct timeval* timeout;
    select(1,&fdSet, nullptr, nullptr,timeout);
    struct epoll_event eventItem;
    eventItem.events = EPOLLIN|EPOLLET;
    eventItem.data.fd = inotifyFd;
//    epoll_ctl(epollFd, EPOLL_CTL_ADD, inotifyFd, &eventItem);

    std::string hello = "Hello from C++";
    return env->NewStringUTF(hello.c_str());
}